import request from '@/utils/request'

// 查询产品类型列表
export function listVideo(query) {
  return request({
    url: '/product/video/list',
    method: 'get',
    params: query
  })
}

// 查询产品类型详细
export function getVideo(id) {
  return request({
    url: '/product/video/' + id,
    method: 'get'
  })
}

// 新增产品类型
export function addVideo(data) {
  return request({
    url: '/product/video/add',
    method: 'post',
    data: data
  })
}

// 修改产品类型
export function updateVideo(data) {
  return request({
    url: '/product/video/update',
    method: 'put',
    data: data
  })
}

// 删除视频
export function delVideo(id) {
  return request({
    url: '/product/video/' + id,
    method: 'delete'
  })
}

// 用户状态修改
export function upateIfIndex(id, ifIndex) {
  const data = {
    id,
    ifIndex
  }
  return request({
    url: '/product/video/changeIfIndex',
    method: 'put',
    data: data
  })
}

export function uploadFileImg(data) {
  return request({
    url: '/product/video/upload/img',
    method: 'post',
    data: data
  })
}

export function batchUpdateStatus(data) {
  return request({
    url: '/product/video/batchUpdateStatus',
    method: 'post',
    data: data
  })
}

export function updateStatus(data) {
  return request({
    url: '/product/video/updateStatus',
    method: 'post',
    data: data
  })
}
